﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Com.JunCaiSoft.Accountant.Entity
{
    /// <summary>
    /// 会计分录
    /// </summary>
    public class Entry
    {
        /// <summary>
        /// 借方会计科目
        /// </summary>
        public virtual List<Subject> CreditSubject { get; set; }
        /// <summary>
        /// 贷方会计科目
        /// </summary>
        public virtual List<Subject> DebitSubject { get; set; }
        /// <summary>
        /// 借方合计金额
        /// </summary>
        public virtual Double CreditSumAmount { get { return CreditSubject.Sum(x => x.Amount); } }
        /// <summary>
        /// 贷方合计金额
        /// </summary>
        public virtual Double DebitSumAmount { get { return DebitSubject.Sum(x => x.Amount); } }
        /// <summary>
        /// 记账时间
        /// </summary>
        public virtual DateTime BookDate { get; set; }
    }
}
